using System.Collections.Generic;

namespace Demo.Models
{
	public interface IRepository<T> where T : IdentifiableEntity
	{
		/// <summary>
		/// Find an entity by unique identifier.
		/// </summary>
		T Find(int id);

		/// <summary>
		/// Save the entity on next flush of the unit of work.
		/// </summary>
		void Save(T entity);

		/// <summary>
		/// Finds all entities in the repository.
		/// </summary>
		IEnumerable<T> FindAll();
	}
}